#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QTimer>
#include <QMainWindow>
#include <QVector>
#include <QList>
#include <QMouseEvent>
#include <QClipboard>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

protected:
    void paintEvent(QPaintEvent *);
    void keyPressEvent(QKeyEvent *event);
    void keyReleaseEvent(QKeyEvent *event);
    void mousePressEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);

public slots:
    void cursorTimeout(QPrivateSignal);

private:
    bool cursor_show;
    QTimer timer;
    int cursor_x;
    int cursor_y;
    int text_line;
    int text_column;
    int start_sel_text_x;
    int start_sel_text_y;
    int end_sel_text_x;
    int end_sel_text_y;
    bool is_mouse_down;
    bool is_ctrl;
    QString selected_text;
    QClipboard *cb;
    QVector<QList<QString>> lines;
    Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H
